from pygame import *


class Splashload:
    __slots__=("progress", "total", "screen")
    
    def __init__(self, total, screen):
        print("init Splashload")
        self.total = total
        self.progress = 0
        self.screen = screen
        
        
    def next(self):
        self.progress += 1
        print("loaded:", (self.progress * 100)  / self.total, "%")
        draw.rect(self.screen, Color(100, 255, 100),\
                   (0, 0, self.screen.get_width() / self.total * self.progress,\
                   self.screen.get_height()))

        display.flip()
